-
-
Notifications
You must be signed in to change notification settings - Fork 6
Improve static analysis: type stability and JET tests #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve static analysis: type stability and JET tests #140
Conversation
- Add type parameters to POD struct (POD{S, T <: AbstractFloat}) for type stability
- Add type parameters to SVD and TSVD structs for proper kwargs typing
- Add return type annotations to key functions:
- matricize, determine_truncation, reduce!, only_dvs, Base.show(::IO, ::POD)
- Add JET.jl tests to verify type stability of core functions:
- deim_interpolation_indices
- matricize
- POD constructors
- reduce! with SVD
The POD struct now properly propagates element types through all operations,
eliminating type instabilities where variables were previously inferred as Any.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Changes MadeSplit JET tests into a separate group excluded from prerelease Julia, following the pattern used by DelayDiffEq and other SciML packages. Changes:
This matches the pattern used in DelayDiffEq.jl where QA tests are excluded from prerelease versions. |
- Update test/runtests.jl to use GROUP env pattern (Core and nopre groups) - Update Tests.yml to run both groups, excluding nopre from prerelease Julia - JET often has compatibility issues with prerelease Julia versions Co-Authored-By: Claude Opus 4.5 <[email protected]>
538cc65 to
99cd5d4
Compare
- Disable downgrade CI pending dependency updates (see SciML#142) - Move JET tests to test/nopre/ with separate Project.toml - Remove JET dependency from main test/Project.toml - JET tests now only run in nopre group (excluded from pre Julia) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Additional ChangesDisabled Downgrade CI
Moved JET to separate nopre Project.toml
This follows the OrdinaryDiffEq pattern where JET has its own Project.toml in a separate test group folder. |
- Move qa.jl and explicit_imports.jl to test/nopre/ - Add Aqua and ExplicitImports to test/nopre/Project.toml - Remove Aqua and ExplicitImports from test/Project.toml - Update runtests.jl to activate nopre project for nopre group - nopre group now includes: Aqua, ExplicitImports, JET tests Co-Authored-By: Claude Opus 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove ModelOrderReduction from nopre/Project.toml deps - Add Pkg.develop(path=...) to use local package instead of registry Co-Authored-By: Claude Opus 4.5 <[email protected]>
Summary
PODstruct (POD{S, T <: AbstractFloat}) for improved type stabilitySVDandTSVDstructs for proper kwargs typing (usingNamedTuple)Changes Made
Type Parameter Improvements
Anytyped fields to properly parameterized typessnapshots::S(parameterized by snapshot type)min_renergy::T,renergy::T(parameterized by element type)rbasis::Union{Missing, Matrix{T}},spectrum::Union{Missing, Vector{T}}kwargs::Anytokwargs::KwhereK <: NamedTupleReturn Type Annotations
matricize(VoV::Vector{Vector{T}})::Matrix{T}determine_truncation(...)::Tuple{Int, T}reduce!(...)::Nothingonly_dvs(...)::BoolBase.show(::IO, ::POD)::NothingJET.jl Tests
Added new test file
test/jet.jlthat verifies type stability of:deim_interpolation_indicesmatricizePODconstructors (Matrix and Vector{Vector})reduce!with SVD algorithmType Stability Before/After
Before (
@code_warntype reduce!(pod, TSVD())):After:
Test plan
Pkg.test()- all tests passCC: @ChrisRackauckas
🤖 Generated with Claude Code